<?php
/**
 * Copyright © 2016 Magento. All rights reserved.
 * See COPYING.txt for license details.
 */

// @codingStandardsIgnoreFile

/** @var \Magento\Customer\Block\Widget\Dob $block */

/*
<?php echo $block->getLayout()->createBlock('Magento\Customer\Block\Widget\Dob')
   ->setDate($block->getCustomer()->getDob())
   ->toHtml() ?>

For checkout/onepage/billing.phtml:

<?php echo $block->getLayout()->createBlock('Magento\Customer\Block\Widget\Dob')
   ->setDate($block->getCustomer()->getDob())
   ->setFieldIdFormat('billing:%s')
   ->setFieldNameFormat('billing[%s]')
   ->toHtml() ?>

NOTE: Regarding styles - if we leave it this way, we'll move it to boxes.css. Alternatively we could calculate widths
automatically using block input parameters.
*/

$fieldCssClass = 'field date field-' . $block->getHtmlId();
$fieldCssClass .= $block->isRequired() ? ' required' : '';
?>
<div class="<?php echo $block->escapeHtmlAttr($fieldCssClass); ?>">
    <label class="label" for="<?php echo $block->escapeHtmlAttr($block->getHtmlId()) ?>"><span><?php echo $block->escapeHtml($block->getLabel()) ?></span></label>
    <div class="control customer-dob">
        <?php echo $block->getFieldHtml(); ?>
        <?php if ($_message = $block->getAdditionalDescription()) : ?>
            <div class="note"><?php echo $block->escapeHtml($_message); ?></div>
        <?php endif; ?>
    </div>
</div>
